package com.rykj.energy.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rykj.energy.common.dto.TaskCameraRelationDto;
import com.rykj.energy.database.pojo.TaskCameraRelation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TaskCameraRelationMapper extends BaseMapper<TaskCameraRelation> {

    List<TaskCameraRelationDto> findTasksByStatus(@Param("status") String status) throws Exception;

    List<TaskCameraRelationDto> findUnCloseByTaskId(@Param("taskId") int taskId,String status) throws Exception;

    List<TaskCameraRelationDto> findUnCloseByCameraId(@Param("cameraId") int cameraId) throws Exception;

    void saveTaskCameras(@Param("taskCameras") List<TaskCameraRelationDto> taskCameras) throws Exception;

    void deleteByTaskId(@Param("taskId") int taskId) throws Exception;

    void updateTaskCamera(@Param("relation") TaskCameraRelationDto relation) throws Exception;

    TaskCameraRelation findByTaskIdAndCameraIdAndPreseId(@Param("taskId")Integer taskId,@Param("cameraId") Integer cameraId,@Param("presetId") Integer presetId);

    List<TaskCameraRelationDto> getAllByCameraIdAndStatus(@Param("cameraId")String cameraId,@Param("tasksStatus") String tasksStatus);

    void updateTaskClose(@Param("delIds") List<Integer> delIds);

    void updateBusinessContent(@Param("delIds")List<Integer> delIds);
}
